import React, { useEffect, useState } from "react";
import { FastData } from "@/api";
import SubjectListItem from "../Home/components/subjectListItem";
import "./fast.less";
// 快速刷题页面
export default function Fast() {
  const [state, setState] = useState<IFastData>();
  useEffect(() => {
    FastData().then((res) => {
      if (res.errCode === 0) {
        setState(res.data);
      }
    });
  });
  return (
    <div className="fast">
      {state?.records.map((item) => (
        <SubjectListItem buttonText="刷题" data={item} isFast={true} />
      ))}
    </div>
  );
}
